class  MyQueueForArray {
    constructor() {
        this.items = [];
    }

    push(element) {
        this.items.push(element);
    }

    pop() {
        return this.items.shift();
    }

    peek() {
        return this.items[0];
    }

    isEmpty() {
        return this.items.length === 0;
    }
    
    size() {
        return this.items.length;
    }
}


const myQueueForArray = new MyQueueForArray();
myQueueForArray.push(1);
myQueueForArray.push(2);
myQueueForArray.push(3);
console.log(myQueueForArray.peek());
console.log(myQueueForArray.pop());
console.log(myQueueForArray.isEmpty());
console.log(myQueueForArray.size());